import { Injectable, NestMiddleware } from '@nestjs/common';
import { Request, Response, NextFunction } from 'express';

@Injectable()
export class CatsMiddleware implements NestMiddleware {
  use(req: Request, res: Response, next: NextFunction) {
    // console.log('中间件触发~');
    next();
  }
}

// 函数式中间件(功能中间件)
// 当你的中间件不需要任何依赖时，请考虑使用更简单的功能中间件替代方案
export function logger(req: Request, res: Response, next: NextFunction) {
  //   console.log('函数式中间件触发~');
  next();
}
